﻿namespace PowerSong.UserInterface
    {
    using System;
    using System.IO;
    using System.Windows.Controls;

    /// <summary>
    /// Interaction logic for VideoPlaybackPanel.xaml
    /// </summary>
    public partial class VideoPlaybackPanel : UserControl
        {

        public VideoServiceItem Video { get; private set; }

        public VideoPlaybackPanel()
            {
            InitializeComponent();
            this.Video = null;
            }

        public void ChangeVideo(VideoServiceItem video)
            {
            
            this.Video = video;

            FileNameTextBlock.Text = Path.GetFileName(video.FileName);
            StartTextBlock.Text = TimeSpan.FromSeconds(0).ToString();
            EndTextBlock.Text = TimeSpan.FromSeconds(12345).ToString();

            }

        private void StopButton_Click(object sender, System.Windows.RoutedEventArgs e)
            {
            State.Theatre.StopVideo();
            }

        private void PauseButton_Click(object sender, System.Windows.RoutedEventArgs e)
            {
            State.Theatre.PauseVideo();
            }

        private void PlayButton_Click(object sender, System.Windows.RoutedEventArgs e)
            {
            State.Theatre.PlayVideo(Video.FileName, new TimeSpan(0, 0, 0), 1, 1, true);
            }

        }

    }
